<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('Epicrisis:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('jdMenu');
		echo $this->Html->css('rm');
		echo $this->Html->css('calendar');
		echo $this->Html->css('jquery.autocomplete');
		echo $scripts_for_layout;

		echo $javascript->link('prototype-1.6.0.3');
		echo $javascript->link('scriptaculous');
		echo $javascript->link('jquery-1.3.2.min'); 

		echo $javascript->link('jquery.autocomplete'); 
		echo $javascript->link('jquery.dimensions'); 
		echo $javascript->link('hoverIntent'); 
		echo $javascript->link('jquery.corner'); 
		echo $javascript->link('jquery.jdMenu'); 
	?>

<SCRIPT LANGUAGE="JavaScript">
<!--
	jQuery(document).ready(function($){ 

		// Declaro el Autocomplete
		$('#PersonName').autocomplete("/people/autoComplete", {
				width: 360,
				scroll: false,
				autoFill: false,
				minChars: 0,
				mustMatch: true,
				matchContains: false
			}
		);

		$('#PersonName').result(function(event, data, formatted) {
			$(location).attr('href',"/people/view/" + data[1]);
//			$("#id_persona_carga").val( !data ? "" : data[1]);
		});

	});
//-->
</SCRIPT>
</head>
<body>
<script type="text/javascript">$j = jQuery.noConflict();</script> 
	<!-- start header -->
	<div id="logo_logueado">
		<h1>Epicrisis&nbsp;<img src="/images/icon_beta.png" border="0"></h1>
		<div id="usuario_logueado">
		    <?php //echo $session->read('Auth.User.first_name')." ".$session->read('Auth.User.last_name'); ?>
		    <?php echo $html->link('Logout', array('controller' => 'users', 'action' => 'logout')); ?>
		</div>
		<div id="buscador_personas">
			<label>Personas</label>
			<input name="data[Person][name]" type="text" id="PersonName" />
			<input type="hidden" id="id_persona_carga" name="id_persona_carga" />			
			<label><a href="/people/add"><img src="/images/ico-add.png" width="20" align="absbottom" alt="Cargar un Nuevo Paciente" title="Cargar un Nuevo Paciente"></a></label>
		</div>
	</div>

	<?php echo $this->element('menu'); ?>

	<!-- end header -->
	<!-- start page -->
	<div id="page">


		<!-- start page -->
		<div id="panel_izquierdo">
			<div id="nombre_cliente"><?php echo $session->read('ClientesUsuarioLogueado.name') ?></div>
			<div id="box">
				<h2>Pacientes en espera</h2>
				<div id="pacientes_espera">Ninguno</div>
			</div>
			<div id="box">
				<h2>Próximos Turnos</h2>
				<div id="proximos_pacientes">Ninguno</div>
			</div>

<?php 
//	echo $calendar->calendar($year, $month, $data, $base_url);
	echo $calendar->calendar();
?>

		</div>
		<div id="panel_derecho">
			<?php echo $this->Session->flash(); ?> 
			<?php echo $content_for_layout; ?>
		</div>
		<!-- end page -->

		

		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end page -->
	<div id="footer">
		<?php echo $this->element('pie'); ?>
	</div>

</body>
</html>